;(function(global) {
  global.my = {
    template: `
            <div class="flex-wrap my-my-container"  @click="go">
                <div class="my-img">
                  <img :src="myCourseData.coverurl" alt="错误">
                </div>
                <div class="flex my-flex">
                  <div class="my-right-container">
                    <div class="text-ess-1 my-component-title">{{ myCourseData.title }}</div>
                    <div>
                      <div class="flex-wrap flex-justify-between">
                          <div>
                            <p class="my-information my-time">有效期：{{ myCourseData.enddate == false ? '2099-12-31' : myCourseData.enddate }}</p>
                          </div>
                          <div v-if="myCourseData.coursetype == 1">
                            <van-button color="rgb(255,120,0)" @click="goStudy(myCourseData.courseid)">{{ myCourseData.historypace == 1 ? '继续听课' : '进入听课'}}</van-button>
                          </div>
                          <div v-if="myCourseData.coursetype == 2">
                            <van-button color="rgb(255,120,0)" @click="goDoExam">进入做题</van-button>
                          </div>
                      </div>
                    </div>
                  </div>
                </div>
            </div>
        `,
    props: ['myCourseData'],
    data() {
      return {}
    },
    computed: {},
    methods: {
      goStudy(courseid) {
        location.href = `../courseCenter/videoCourse.html?courseid=${courseid}`
      },
      goDoExam() {
        location.href = `../examCenter/topic.html`
      },
      go() {
        if (this.myCourseData.coursetype === 1) {
          this.goStudy(this.myCourseData.courseid)
        }
        if (this.myCourseData.coursetype === 2) {
          this.goDoExam()
        }
      }
    },
    created() {},
    mounted() {}
  }
})(window)
